package com.java123.t8.demo;

import java.util.ArrayList;
import java.util.List;

import com.java123.t8.demo.entity.Student;

public class TryDemo {

	public static void main(String[] args) {
		// 错误，编译时错误
		// 运行时错误（runtime exception）
		List<Student> stus = new ArrayList<Student>();
		stus.add(new Student());
		System.out.println(stus.size());
		stus.get(1);
		try {
			testSome();
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(1 / 0);
		System.out.println("程序结束");
	}

	@SuppressWarnings("null")
	private static void testSome() throws Exception {
		List<Student> stus = null;
		stus.add(new Student());
	}
}
